home *** CD-ROM | disk | FTP | other *** search
/ The X-Philes (2nd Revision) / The X-Philes Number 1 (1995).iso / xphiles / hp48_2 / change_c < prev    next >
Internet Message Format  |  1995-03-31  |  4KB

  1. From comp.sys.handhelds Sun Jun  9 13:13:18 1991
  2. Path: seq!ecsgate!mcnc!uvaarpa!haven.umd.edu!ames!think.com!spool.mu.edu!uunet!munnari.oz.au!bunyip.cc.uq.oz.au!brolga!uqcspe!cs.uq.oz.au!grue
  3. From: grue@cs.uq.oz.au (Frobozz)
  4. Newsgroups: comp.sys.handhelds
  5. Subject: Re: Misc. m/l string functs. hp48
  6. Keywords: string, m/l
  7. Message-ID: <1774@uqcspe.cs.uq.oz.au>
  8. Date: 5 Jun 91 01:41:31 GMT
  9. References: <284813da:3337comp.sys.handhelds@hpcvbbs.UUCP>
  10. Sender: news@cs.uq.oz.au
  11. Reply-To: grue@cs.uq.oz.au
  12. Lines: 95
  13.  
  14. In <284813da:3337comp.sys.handhelds@hpcvbbs.UUCP> akcs.scotty@hpcvbbs.UUCP (SCOTTY THOMPSON) writes:
  15.  
  16. >My first attempts at m/l programming (something simple, yet sweet) were
  17. >very successful.  Thanks to all who have submitted information to the
  18. >board!
  19.  
  20. Don't get put off by what I'm posting, it isn't meant as a direct flame
  21. just a word of caution to other users out there.
  22.  
  23.  
  24. >The following code, in ASC-> format are simple string functions for
  25. >Lower-case, Upper-case, UpperFirst (which upper-cases the first character
  26. >after any punctuation and lower-cases the rest).
  27.  
  28. >LC$
  29. >--------------------
  30. >%%HP: T(1)A(D)F(.);
  31. >"D9D20D29512BF81D0040D9D20CCD20A50008FB976020143130164142818F8542
  32. >3D816414A31149E25131A59E6C03102A6A148161818F9157D8D34150B2130B21
  33. >3038F1"
  34.  
  35. >{Converts string in level 1 to lower-case}
  36.  
  37. >UC$
  38. >---------------------
  39. >%%HP: T(1)A(D)F(.);
  40. >"D9D20D29512BF81D0040D9D20CCD20A50008FB976020143130164142818F8542
  41. >3D816414A31169E25131A79E6C03102B6A148161818F9157D8D34150B2130B21
  42. >30DBDF"
  43.  
  44. >{Converts string in level 1 to upper-case}
  45.  
  46. These two routines work quite well but they have some problems.
  47. Firstly, they don't handle the full extended character set of the
  48. HP48.  It is possible to get all kinds of special characters from the
  49. keyboard.  Enter alpha mode and press: O blue-shift 9 and you should
  50. end up with a capital O with a slash across it.  Most of these
  51. international characters are available in both upper and lower case.  It
  52. would be nice for these case conversion routines to handle these extra
  53. characters properly.
  54.  
  55. Secondly, and maybe more importantly, these routines do not make a copy
  56. of the string before case conversion is performed.  Try this:
  57. "AbCdEf" ENTER ENTER
  58.  
  59. The stack should look like:
  60. 2: "AbCdEf"
  61. 1: "AbCdEf"
  62.  
  63. Press UC$ and you'll get:
  64. 2: "ABCDEF"
  65. 1: "ABCDEF"
  66.  
  67. and moreover, you are not able to undo the operation (try it).  This could
  68. lead to some unexpected results!
  69.  
  70.  
  71. Now that I've said my bit, I'll include some routines that do work as I've
  72. indicated.  These two routines handle the entire extended character set
  73. (except for the greek letters, there are hardly any cases where both the
  74. lowercase and the uppercase character exist), they also duplicate the string
  75. before conversion (try the previous test using my routines and it will
  76. work as expected) and they also verify that they are passed a string...
  77. (i.e. they are just about idiot proof --- famous last words :-)
  78.  
  79. These routines take up approximately 20 extra bytes each, a small price
  80. to pay for added safety.
  81.  
  82.  
  83. This one converts any lowercase characters to upper case.
  84.  
  85. "D9D20ECE81D0040D9D2075660CCD20380008FB9760147134164146819F2CECE8
  86. AAE4D71643106AE514A9EC0331B79EAD131FD9EAE1317F9625131FF962C0310E
  87. A6A148161CF8AF2C8F2D760142164808CB2130B2130BDE1"
  88.  
  89.  
  90.  
  91. And this one changes upper case to lower.
  92.  
  93. "D9D20ECE81D0040D9D2075660CCD20380008FB9760147134164146819F2CECE8
  94. AAE4D71643104AE514A9EC0331B59EAD131FB9EAE131FD9EE51317D962C03102
  95. A6A148161CF8AF2C8F2D760142164808CB2130B2130803A"
  96.  
  97.  
  98.  
  99.                                 Pauli
  100. seeya
  101.  
  102. Paul Dale               | Internet/CSnet:            grue@cs.uq.oz.au
  103. Dept of Computer Science| Bitnet:       grue%cs.uq.oz.au@uunet.uu.net
  104. Uni of Qld              | JANET:           grue%cs.uq.oz.au@uk.ac.ukc
  105. Australia, 4072         | EAN:                          grue@cs.uq.oz
  106.                         | UUCP:           uunet!munnari!cs.uq.oz!grue
  107. f4e6g4Qh4++             | JUNET:                     grue@cs.uq.oz.au
  108. --
  109.  
  110.